<template>
  <div>
    <h1>App组件</h1>
    <div>
      <button @click="waiFn">看外套</button>
      <button @click="kuFn">看裤子</button>
    </div>
    <!-- <ul>
      <li><router-link to="/goods?name=外套">看外套</router-link></li>
      <li><router-link to="/goods/裤子">看裤子</router-link></li>
    </ul> -->
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  methods: {
    waiFn() {
      this.$router.push({
        path: "/goods",
        query: {
          name: "外套",
        },
      });
    },
    kuFn() {
      this.$router.push({
        name: "thegoods",
        params: {
          goodsname: "裤子",
        },
      });
    },
  },
};
</script>

<style>
</style>